#include <iostream>
#include <string>
#include<vector>
using namespace std;

vector<string> split(string str, string pattern)
{
    string::size_type pos;
    vector<string> result;
    str += pattern;
    int size = str.size();
    for (int i = 0; i < size; i++)

    {
        pos = str.find(pattern, i);
        if (pos < size)
        {
            string s = str.substr(i, pos - i);
            result.push_back(s);
            i = pos + pattern.size() - 1;
        }
    }
    return result;
}

int main() {
    string str;
    getline(cin, str);
    vector<string> arr = split(str, " ");
    string result = arr[arr.size() - 1];
    cout << result.size();
    return 0;
}